function get_channels(cb_success,cb_fail,cb_error) {
    fetch(`/api/channels`, {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json'
        }
    }).then(response => response.json()).then(res =>{
        if(res["success"]!=true) {
            console.error("Fail to get channels: " + res["err"])
            cb_fail(err);
        }else{
            cb_success(res);
        }
    }).catch(err=>{
        console.error("Error getting channels: " + err)
        cb_error(err);
    });
}